<script setup lang="ts">
import { ref } from "vue";
import xmzs from "@/assets/xmzs.png"
import fxwtzs from "@/assets/fxwtzs.png"
import jzb from "@/assets/jzb.png"
import zgwt from  "@/assets/zgwt.png"
import zgwtje from "@/assets/zgwtje.png"
import zzwz from "@/assets/zzwz.png"

const stats = ref([
  { value: "50240", label: "项目总数", icon: xmzs },
  { value: "1240", label: "发现问题总数", icon: fxwtzs },
  { value: "5,0240", label: "发现问题金额(元)", icon: jzb},
  { value: "1200", label: "整改问题总数", icon: zgwt},
  { value: "5,0000", label: "整改问题金额(元)", icon: zgwtje},
  { value: "240", label: "追责问责数", icon:  zzwz}
]);
</script>


<template>
  <div class="stats-container">
    <div v-for="(item, index) in stats" :key="index" class="stat-card">
      <div class="stat-content">
        <h2>{{ item.value }}</h2>
        <p>{{ item.label }}</p>
      </div>
      <img :src="item.icon" alt="logo" class="stat-logo" />
    </div>
  </div>
</template>


<style scoped>
.stats-container {
  width: 1900px;
  display: flex;
  justify-content: space-around;
  padding: 20px;
}
.stat-card {
  width: 300px;
  height: 150px;
  display: flex;
  justify-content: space-between; /* 添加此行来确保内容和图标分开 */
  align-items: center;
  background-color: #ffffff; /* 纯白背景 */
  border: 5px solid; /* 边框宽度 */
  border-image: url('@/assets/jxk.png') 5 stretch;
  border-radius: 10px; /* 增大圆角弧度 */
  overflow: hidden; /* 确保圆角效果应用到内容 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 轻微的阴影效果 */
  padding-left: 20px;
  padding-right: 20px; /* 确保有足够的间距来容纳图片 */
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-card h2 {
  font-size: 30px;
  color: #000;
  font-weight: 900;
  text-align: left;
  margin: 0;
}
.stat-card p {
  font-size: 20px;
  color: rgb(114, 118, 123);
  text-align: left;
  margin: 0;
}

.stat-logo {
  width: 70px; /* 设置图标的宽度 */
  height: auto; /* 保持图标比例 */
}
</style>
